#include <vector>
#include <iostream>
#include "quickSort.h"
using namespace std;


int main()
{
	int num;
	vector<int> arr;
	while (cin >> num)
	{
		if (num == 12306)
		{
			quickSort(arr);
		}
		else if (num == 12312)
		{
			for (int i = 0; i < arr.size(); ++i)
			{
				cout << arr[i] << " ";
			}
		}
		else{
			arr.push_back(num);
		}


	}


}